/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function initDetalleGrid (){
    $("#detalle_grid").jqgrid({
        url: "documentoDetalle.do",
        datatype: "jason",
        width: 100,
        height: 80,
        colNames:['Documentos Anexos','Opcion'],
        colModel:[
        {
            name: "documents",
            index: "documents",
            sortable: true,
            width:55
        },
        {
            name: "options",
            index: "options",
            sortable: true,
            width:55
        }
        ],
        
        rowNum:10,
        rowList:[10,20,30],
        pager: '#detalle_pager',
        sortname: 'folio',
        viewrecords: true,
        sortable: true,
        sortorder: "desc",
        multiselect: false,
        caption:"Detalle de Documentos Anexos",
        loadonce : false,
        rowTotal: 'total',
        records:'records',
        jsonReader: {
            repeatitems: false,
            id: "folio"
        },
        
        gridComplete: function (){
            var ids =$("#detalle_grid").jqGrid('getDataIDs');
	  
            for(var i=0;i < ids.length;i++){
                var folio_ = ids[i]; 
               
                icon2= " <img src='img/accept.png'alt='Aceptar' title='Aceptar' height='16' onclick=\"changeStatusSolicitudAcceso('"+folio_+"',1);\" width='16'  />";
                icon3= " <img src='img/icon2.png' alt='Rechazar' title='Rechazar' height='18' onclick=\"changeStatusSolicitudAcceso('"+folio_+"',2);\" width='18'  />";
                $("#detalle_grid").jqGrid('setRowData',ids[i],{
                    actions:icon2+icon3
                }); 
            } 
        }
    });
    $("#generalistas_grid").jqGrid('navGrid','#generalistas_pager',{
        edit:false,
        add:false,
        view :true,
        del:false
    },{},{},{
        closeAfterEdit:true
    },{} );
}
        
//    })
//}
